<?xml version="1.0" encoding="UTF-8"?>
<ticket>
  <assigned-user-id type="integer">11063</assigned-user-id>
  <attachments-count type="integer">1</attachments-count>
  <closed type="boolean">true</closed>
  <created-at type="datetime">2009-06-23T09:08:53-04:00</created-at>
  <creator-id type="integer">40820</creator-id>
  <milestone-due-on type="datetime" nil="true"></milestone-due-on>
  <milestone-id type="integer" nil="true"></milestone-id>
  <number type="integer">14</number>
  <permalink>component-without-recurrence-properties-should-enumerate-just-itself-only-if-it-is-within-the-period-between-starting-and-before</permalink>
  <priority type="integer">118641</priority>
  <project-id type="integer">30941</project-id>
  <raw-data type="binary" nil="true" encoding="base64"></raw-data>
  <state>resolved</state>
  <tag>before empty non occurrences recurring rrule starting</tag>
  <title>Component without recurrence properties should enumerate just itself only if it is within the period between :starting and :before</title>
  <updated-at type="datetime">2009-07-06T16:31:43-04:00</updated-at>
  <user-id type="integer">40820</user-id>
  <user-name>Klaas Jan Wierenga</user-name>
  <creator-name>Klaas Jan Wierenga</creator-name>
  <assigned-user-name>Rick DeNatale</assigned-user-name>
  <url>http://rick_denatale.lighthouseapp.com/projects/30941/tickets/14</url>
  <original-body>I wrote the attached failing spec to show what the problem is (expected 0 got 1)

* Single event without recurrence. Date is before :starting date. event.occurrences still returns a single occurrence (with a date before :starting). This is unexpected. I think OccurrenceEnumerator::EmptyRulesEnumerator should be modified to handle this case, but I don't known how.

-----

$ git diff
diff --git a/spec/ri_cal/occurrence_enumerator_spec.rb b/spec/ri_cal/occurrence_enumerator_spec.rb
diff --git a/spec/ri_cal/occurrence_enumerator_spec.rb b/spec/ri_cal/occurrence_enumerator_spec.rb
index cb5ddcf..af68a50 100644
--- a/spec/ri_cal/occurrence_enumerator_spec.rb
+++ b/spec/ri_cal/occurrence_enumerator_spec.rb
@@ -70,6 +70,19 @@ TEXT
           result.map{|o|o.dtstart}.should == Fr13UnboundedZuluExpectedFive[0..2].map{|e| e.dtstart}
         end
       end
+      
+      describe &quot;for a non-recurring event with :starting and :before specified&quot; do
+        it &quot;should exclude dates before :starting and after :before&quot; do
+          first = Time.now + (3600*24*31) # 31 days from now
+          last  = first + (3600*24*31) # 31 days later
+          event = RiCal.Event do |event|
+            event.dtstart = Time.now.utc
+            event.dtend   = Time.now.utc + 3600
+            # event.rrule  (no recurrence, single event)
+          end
+          event.occurrences(:starting =&gt; first, :before =&gt; last).size.should eql(0)
+        end
+      end
     end
   end</original-body>
  <latest-body>I wrote the attached failing spec to show what the problem is (expected 0 got 1)

* Single event without recurrence. Date is before :starting date. event.occurrences still returns a single occurrence (with a date before :starting). This is unexpected. I think OccurrenceEnumerator::EmptyRulesEnumerator should be modified to handle this case, but I don't known how.

-----

$ git diff
diff --git a/spec/ri_cal/occurrence_enumerator_spec.rb b/spec/ri_cal/occurrence_enumerator_spec.rb
diff --git a/spec/ri_cal/occurrence_enumerator_spec.rb b/spec/ri_cal/occurrence_enumerator_spec.rb
index cb5ddcf..af68a50 100644
--- a/spec/ri_cal/occurrence_enumerator_spec.rb
+++ b/spec/ri_cal/occurrence_enumerator_spec.rb
@@ -70,6 +70,19 @@ TEXT
           result.map{|o|o.dtstart}.should == Fr13UnboundedZuluExpectedFive[0..2].map{|e| e.dtstart}
         end
       end
+      
+      describe &quot;for a non-recurring event with :starting and :before specified&quot; do
+        it &quot;should exclude dates before :starting and after :before&quot; do
+          first = Time.now + (3600*24*31) # 31 days from now
+          last  = first + (3600*24*31) # 31 days later
+          event = RiCal.Event do |event|
+            event.dtstart = Time.now.utc
+            event.dtend   = Time.now.utc + 3600
+            # event.rrule  (no recurrence, single event)
+          end
+          event.occurrences(:starting =&gt; first, :before =&gt; last).size.should eql(0)
+        end
+      end
     end
   end</latest-body>
  <original-body-html>&lt;div&gt;&lt;p&gt;I wrote the attached failing spec to show what the problem is
(expected 0 got 1)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Single event without recurrence. Date is before :starting date.
event.occurrences still returns a single occurrence (with a date
before :starting). This is unexpected. I think
OccurrenceEnumerator::EmptyRulesEnumerator should be modified to
handle this case, but I don't known how.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;$ git diff diff --git
a/spec/ri_cal/occurrence_enumerator_spec.rb
b/spec/ri_cal/occurrence_enumerator_spec.rb diff --git
a/spec/ri_cal/occurrence_enumerator_spec.rb
b/spec/ri_cal/occurrence_enumerator_spec.rb index cb5ddcf..af68a50
100644 --- a/spec/ri_cal/occurrence_enumerator_spec.rb +++
b/spec/ri_cal/occurrence_enumerator_spec.rb @@ -70,6 +70,19 @@
TEXT&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;       result.map{|o|o.dtstart}.should == Fr13UnboundedZuluExpectedFive[0..2].map{|e| e.dtstart}
     end
   end
&lt;/code&gt;
&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;describe &quot;for a non-recurring event with :starting and :before
specified&quot; do&lt;/li&gt;
&lt;li&gt;
&lt;pre&gt;
&lt;code&gt; it &quot;should exclude dates before :starting and after :before&quot; do
&lt;/code&gt;
&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;pre&gt;
&lt;code&gt;   first = Time.now + (3600*24*31) # 31 days from now
&lt;/code&gt;
&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;pre&gt;
&lt;code&gt;   last  = first + (3600*24*31) # 31 days later
&lt;/code&gt;
&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;pre&gt;
&lt;code&gt;   event = RiCal.Event do |event|
&lt;/code&gt;
&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;pre&gt;
&lt;code&gt;     event.dtstart = Time.now.utc
&lt;/code&gt;
&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;pre&gt;
&lt;code&gt;     event.dtend   = Time.now.utc + 3600
&lt;/code&gt;
&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;pre&gt;
&lt;code&gt;     # event.rrule  (no recurrence, single event)
&lt;/code&gt;
&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;pre&gt;
&lt;code&gt;   end
&lt;/code&gt;
&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;pre&gt;
&lt;code&gt;   event.occurrences(:starting =&amp;gt; first, :before =&amp;gt; last).size.should eql(0)
&lt;/code&gt;
&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;pre&gt;
&lt;code&gt; end
&lt;/code&gt;
&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;end end end&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</original-body-html>
  <versions type="array">
    <version type="Ticket::Version">
      <assigned-user-id type="integer">11063</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>I wrote the attached failing spec to show what the problem is (expected 0 got 1)

Given a single event without recurrence (no rrule set). Date is before :starting date. event.occurrences still returns a single occurrence (with a date before :starting). This is unexpected. I think OccurrenceEnumerator::EmptyRulesEnumerator should be modified to handle this case, but I don't known how.</body>
      <body-html>&lt;div&gt;&lt;p&gt;I wrote the attached failing spec to show what the problem is
(expected 0 got 1)&lt;/p&gt;
&lt;p&gt;Given a single event without recurrence (no rrule set). Date is
before :starting date. event.occurrences still returns a single
occurrence (with a date before :starting). This is unexpected. I
think OccurrenceEnumerator::EmptyRulesEnumerator should be modified
to handle this case, but I don't known how.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-06-23T09:08:53-04:00</created-at>
      <creator-id type="integer">40820</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">14</number>
      <permalink>component-without-recurrence-properties-should-enumerate-just-itself-only-if-it-is-within-the-period-between-starting-and-before</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">30941</project-id>
      <state>new</state>
      <tag>before empty non occurrences recurring rrule starting</tag>
      <title>Component without recurrence properties should enumerate just itself only if it is within the period between :starting and :before</title>
      <updated-at type="datetime">2009-06-23T09:11:05-04:00</updated-at>
      <user-id type="integer">40820</user-id>
      <user-name>Klaas Jan Wierenga</user-name>
      <creator-name>Klaas Jan Wierenga</creator-name>
      <assigned-user-name>Rick DeNatale</assigned-user-name>
      <url>http://rick_denatale.lighthouseapp.com/projects/30941/tickets/14</url>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">11063</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>Forgot to close this. Fix was in 0.7.0</body>
      <body-html>&lt;div&gt;&lt;p&gt;Forgot to close this. Fix was in 0.7.0&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2009-07-06T12:08:36-04:00</created-at>
      <creator-id type="integer">40820</creator-id>
      <diffable-attributes type="yaml">--- 
:state: new
</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">14</number>
      <permalink>component-without-recurrence-properties-should-enumerate-just-itself-only-if-it-is-within-the-period-between-starting-and-before</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">30941</project-id>
      <state>resolved</state>
      <tag>before empty non occurrences recurring rrule starting</tag>
      <title>Component without recurrence properties should enumerate just itself only if it is within the period between :starting and :before</title>
      <updated-at type="datetime">2009-07-06T12:08:39-04:00</updated-at>
      <user-id type="integer">11063</user-id>
      <user-name>Rick DeNatale</user-name>
      <creator-name>Klaas Jan Wierenga</creator-name>
      <assigned-user-name>Rick DeNatale</assigned-user-name>
      <url>http://rick_denatale.lighthouseapp.com/projects/30941/tickets/14</url>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">11063</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>excellent, thank you</body>
      <body-html>&lt;div&gt;&lt;p&gt;excellent, thank you&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2009-07-06T16:31:43-04:00</created-at>
      <creator-id type="integer">40820</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">14</number>
      <permalink>component-without-recurrence-properties-should-enumerate-just-itself-only-if-it-is-within-the-period-between-starting-and-before</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">30941</project-id>
      <state>resolved</state>
      <tag>before empty non occurrences recurring rrule starting</tag>
      <title>Component without recurrence properties should enumerate just itself only if it is within the period between :starting and :before</title>
      <updated-at type="datetime">2009-07-06T16:31:43-04:00</updated-at>
      <user-id type="integer">40820</user-id>
      <user-name>Klaas Jan Wierenga</user-name>
      <creator-name>Klaas Jan Wierenga</creator-name>
      <assigned-user-name>Rick DeNatale</assigned-user-name>
      <url>http://rick_denatale.lighthouseapp.com/projects/30941/tickets/14</url>
    </version>
  </versions>
  <attachments type="array">
    <attachment type="Attachment">
      <code>a575e48f07a0636d4b180f7a0c861f7a17619207</code>
      <content-type>text/plain</content-type>
      <created-at type="datetime">2009-06-23T09:08:54-04:00</created-at>
      <filename>occurrence_enumerator_spec.rb.patch</filename>
      <height type="integer" nil="true"></height>
      <id type="integer">136536</id>
      <size type="integer">990</size>
      <uploader-id type="integer">40820</uploader-id>
      <width type="integer" nil="true"></width>
      <url>http://rick_denatale.lighthouseapp.com/attachments/136536/occurrence_enumerator_spec.rb.patch</url>
    </attachment>
  </attachments>
</ticket>
